#include "STEClasses.h"
#include "Value.h"
#include "ParserUtil.h"

#define Ying
/****************************************************************/
/*void GlobalEntry::print(ostream& out, int indent)const 
{
	vector<RuleNode*>::const_iterator  iter;

	this->symTab()->printST(out,indent,' ',' ');
	out<<endl;
	for(iter = rules_.begin(); iter != rules_.end(); iter++)
	{
		(*iter)->print(out,indent);
		out<<endl;
	}
	if(rules_.empty())
		out<<endl;
	out<<endl;

}

void EventEntry::print(ostream& out, int indent)const 
{
	out<<"event "<<this->name();
	if(this->symTab())
	  this->symTab()->printST(out,indent,'(',')',false);
	out<<";";
}

void BlockEntry::print(ostream& out, int indent) const
{
	if(this->symTab())
	  this->symTab()->printST(out,indent);
	
}

VariableEntry::VariableEntry(const VariableEntry &v):SymTabEntry(v.name(),v.kind(),0,0,""){}

void VariableEntry::print(ostream& os, int indent)const
{
	os<<this->type()->name()<<" ";
	if(this->type()->tag() == Type::CLASS)
		os<<this->type()->typeDesc()->name()<<" ";
	os<<this->name();
	if(initVal_ != NULL)
	{
		os<<"=";
		initVal_->print(os,indent);
	}
	if(this->varKind() != VariableEntry::PARAM_VAR)
		cout<<";";	
}

void FunctionEntry::print(ostream& os, int indent) const
{
	os<<this->type()->retType()->name()<<" "<<this->name();
	bool bc = false;
	if(this->body() == NULL)
	{
	if(this->symTab())
	  this->symTab()->printST(os,indent,'(',')',false);
	else 
		os<<"("<<")";
	}
	else
	{
		
		int i = 1;
		SymTab::const_iterator iter(*(this->symTab()->begin()));
		for(; iter != *(this->symTab()->end()); ++iter)
		{	if((*iter)->kind() == SymTabEntry::BLOCK_KIND)
			{
				
				break;
			}
				
			else i++;
		}
		
		
		if(!((*iter)->kind() == SymTabEntry::BLOCK_KIND && i == 1))
			this->symTab()->printST(os,indent,'(',')',false,0,i-1);
		
		else
		{
			os<<"("<<")";
		}		
		os<<"{"<<endl;
		if((*iter)->symTab() != NULL)
		(*iter)->symTab()->printST(os,indent,'\0','\0');
		
		this->body()->printWithoutBraces(os,indent);
		os<<"}";
	}
	os<<";";
}

void ClassEntry::print(ostream& os, int indent)const
{
	os<<"class"<<" "<<this->name()<<";";
}
*/
